﻿@model List<Wicresoft.UnifyShow.Business.DocumentModel>
@{
    ViewBag.Title = "常用资源搜索";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="index_lr">
    <div class="index_lrA_title ui-icons">
        <h3>常用资源搜索</h3>
    </div>
    <div class="index_pt_bg">
        <form action="@Url.Action("SearchResult", "AdminDocument")" method="post" id="documentform" enctype="multipart/form-data">
        <input type="text" name="keywords" id="keywords" />
        <input type="submit" name="submit" value="搜索" />
        </form>
    </div>
    <div class="index_lrA_title ui-icons">
        @*<h3>已有文件</h3>*@
    </div>
    <div class="index_pt_bg" id="ResourceList">
        <table class="talbe_gray" width="100%" border="0" cellpadding="0" cellspacing="0">
            <thead>
                <tr style=" height:20px;">
                    <th class="altrow">
                        名称
                    </th>
                    <th class="altrow">
                        文件
                    </th>
                    <th class="altrow">
                        发布时间
                    </th>
                    <th class="altrow">
                        发布人
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    <tr data-id="@item.ID" style=" height:20px;">
                        <td>
                           @item.DName
                        </td>
                        <td>
                          <a data-id="@item.ID" class="document"> @item.FileName </a>
                        </td>
                        <td>
                            @item.CreateTime
                        </td>
                        <td>
                            @item.Submiter
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>
@section ScriptAndCss{
    <link href="../../Content/css/bsadmin.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">

        $(document).ready(function () {
            $(".document", "#ResourceList").click(function () {
                window.open("@Url.Action("DownLoad", "AdminDocument")" + "?id=" + $(this).attr("data-id"));
            });
        });
    </script>
}

